<template>
	<div class="hy-container">
		<HyTable
			:searchFields="searchFields"
			:searchConfig="searchConfig"
			:searchDefault="searchDefault"
			:tableConfig="tableConfig"
			:tableColumns="tableColumns"
			ref="hyTableRef"
			:buttonConfig="{
				span: 4,
				offset: 1,
			}"
		>
			<template #operation>
				<el-table-column fixed="right" label="操作" width="180">
					<template #default="{ row }">
						<div class="flex flex-col justify-center">
							<el-button class="ml-3" text type="primary" icon="EditPen" @click="goDetail(row, 'true')">意见上传</el-button>
							<el-button class="mt-3" text type="primary" icon="View" @click="goDetail(row, 'false')">查看详情</el-button>
						</div>
					</template>
				</el-table-column>
			</template>
		</HyTable>

		<!-- 评价 -->
		<proGres ref="expertsRevRef" />
	</div>
</template>

<script lang="ts" setup>
import HyTable from '/@/components/HyTable/index.vue';
import proGres from './components/Progress.vue';
import { searchReviewAppPage } from '/@/api/expertDatabase/evaluate';
import { useRouter } from 'vue-router';
import { ElMessageBox } from 'element-plus';
const router = useRouter();
const tableColumns = computed(() => {
	return [
		{ prop: 'appName', label: '应用名称' },
		{ prop: 'belongField', label: ' 所属领域' },
		{ prop: 'responsibleDept', label: '责任部门' },
		{ prop: 'countyLeadDept', label: '市级牵头部门' },
		{ prop: 'designUnit', label: '设计单位' },
		{ prop: 'yearBudget', label: '年度预算(万元)' },
	];
});
const tableConfig = computed(() => {
	return {
		request: searchReviewAppPage,
	};
});

//详情
const goDetail = (row: any, tfOp: any) => {
	router.push({
		path: '/expertDatabase/comments/commentsDetail',
		query: {
			id: row.id,
			tfOp: tfOp, //是否为上传意见
		},
	});
};

// 配置搜索
const searchFields = computed(() => {
	return {
		keyword: {
			type: 'input',
			label: '关键字',
		},
	};
});
const searchConfig = computed(() => {
	return {
		labelWidth: '120px',
		span: 6,
		offset: 0,
		type: 'search',
		title: '应用评审意见',
		show: true,
	};
});
const searchDefault = ref({});
//操作
const hyTableRef = ref();
const expertsRevRef = ref();

//查看进度
const scoreing = () => {
	expertsRevRef.value.dialogVisible = true;
};
</script>
<style scoped lang="scss">
// :deep(.el-form--default) {
// 	justify-content: flex-end;
// }
// :deep(.el-form--default > div) {
// 	margin-left: 30px !important;
// }
</style>
